<?php

namespace App\Http\Controllers;

use App\ArticleModel;
use Illuminate\Http\Request;

class ArticleController extends Controller
{
    //
    public function index(Request $request){
        $minId =$request->input('minId');
        $pageSize = $request->input('pageSize');
      $res= ArticleModel::when(!empty($minId),function($query)use($minId){
          $query->where('id','>',$minId);
      })->paginate($pageSize);
      return response()->json([
          'lists' => $res
      ]);
    }
}
